import { request } from '../utils/request'
const URL = process.env.BASEURL;
 
// 根据银行id查询融资一览
export function selectByBankId(params) {
  if(params.keys==''){
    return request({
      method: 'get',
      url: `finance/selectByBankId/${params.pageNum}`,
      headers: {
          'Authorization': window.localStorage.setToken,
      },
    })
  }else{
    return request({
      method: 'get',
      url: `finance/selectByFinance/${params.keys}/${params.pageNum}`,
      headers: {
          'Authorization': window.localStorage.setToken,
      },
    })
  }
}

// 根据融资id查询融资
export function getFinanceById(params) {
  return request({
      method: 'get',
      url: `/finance/selectById/${params.id}`,
      headers: {
          'Authorization': window.localStorage.setToken,
      },
  })
}

// 根据融资id修改融资getPicById
export function reviseFinanceById(params) {
  return request({
      method: 'put',
      url: 'finance/update',
      headers: {
          'Authorization': window.localStorage.setToken,
      },
      data: params,
  })
}
export function getPicById(params) {
  return request({
      method: 'get',
      url: 'finance/getPic/'+params.id,
      headers: {
          'Authorization': window.localStorage.setToken,
      },
  })
}
// 查询推荐融资人
export function selectRecommend(params) {
  return request({
      method: 'get',
      url: 'finance/selectRecommend/'+params.pageNum,
      headers: {
          'Authorization': window.localStorage.setToken,
      },
  })
}
export function selectBankName() {
  return request({
      method: 'get',
      url: 'finance/selectBankName/',
      headers: {
          'Authorization': window.localStorage.setToken,
      },
  })
}